class Publication {

    String title    
    Date releaseDate
    Boolean visible = Boolean.FALSE
    String description
    String path
    String type

    static constraints = {
        title(nullable:false, blank:false, size:1..150)
        releaseDate(nullable:false)
        visible(nullable:false)
        description(nullable:false, blank:false, size:1..3000)
        path(nullable:false, blank:false, unique:true)
        type(nullable:false, blank:false, inList:['Diplomarbeit', 'Praktikumsarbeit', 'Artikel'])
    }

    static belongsTo = Author
    static hasMany = [authors: Author]

    public String toString() {
        return "${title} - ${path}";
    }
}
